<template>
	<div class="text item el-over-auto" style="padding: 10px 50px;">
		<el-form label-width="80px" :model='editForm'>
			<el-form-item label="节点编码">
				<el-col :span="12">
					<span>{{ editForm.nodeCode }}</span>
				</el-col>
			</el-form-item>
			<el-form-item label="节点名称">
				<el-col :span="12">
					<span>{{ editForm.nodeName }}</span>
				</el-col>
			</el-form-item>
			<el-form-item label="节点类型">
				<el-col :span="12">
					<span>{{ editForm.nodeTypeName }}</span>
				</el-col>
			</el-form-item>
			<el-form-item label="启用状态">
				<el-col :span="12">
					<span>{{ editForm.enabled =="Y"?"启用":"禁用"}}</span>
				</el-col>
			</el-form-item>
			<el-form-item label="排序">
				<el-col :span="12">
					<span>{{ editForm.sortNo}}</span>
				</el-col>
			</el-form-item>
			<el-form-item label="访问地址" v-if="editForm.nodeTypeName=='功能'">
				<el-col :span="16">
					<span>{{editForm.nodeUrl }}</span>
					<el-tag v-if="editForm.realAddr && editForm.realAddr.indexOf('layout')>-1" style="margin-left: 10px;">顶部导航</el-tag>
					<el-tag v-if="editForm.realAddr && editForm.realAddr.indexOf('frame')>-1" style="margin-left: 10px;" type="success">侧边导航</el-tag>
				</el-col>
			</el-form-item>
			<el-form-item label="普通图标">
				<el-col :span="12" class="upload-view-pic upload-no-trans upload-no-preview">
					<!-- <span>{{editForm.nodeIcon }}</span> -->
					<el-upload v-if="editForm.nodeIconD" :disabled="true" list-type="picture-card" :file-list="[{url: nodeIconUrl(editForm.nodeIconD)}]" action="#">
					</el-upload>
				</el-col>
			</el-form-item>
			<el-form-item label="高亮图标">
				<el-col :span="12" class="upload-view-pic upload-no-trans upload-no-preview">
					<!-- <span>{{editForm.nodeIcon }}</span> -->
					<el-upload v-if="editForm.nodeIconL" :disabled="true" list-type="picture-card" :file-list="[{url: nodeIconUrl(editForm.nodeIconL)}]"
					 action="#">
					</el-upload>
				</el-col>
			</el-form-item>
			<el-form-item label="说明">
				<el-col :span="16">
					<span>{{editForm.nodeDesc }}</span>
				</el-col>
			</el-form-item>
		</el-form>
	</div>
</template>

<script>
	import {
		Dialog,
		MessageBox,
		Message,
		Tag,
		Upload
	} from 'element-ui';
	import {
		fileuploadUrl, //文件上传接口（无状态）
		attachPath, //附件绝对地址
		uploadByBusinessUrl, //上传接口
		findAttchList, //获取文件列表
		preview, //预览图片
		deleteAttid //附件删除
	} from '@/api/attachCommon/attachCommon.js'
	export default {
		name: "editForm",
		components: {
			'el-dialog': Dialog, //对话框
			"el-tag": Tag,
			'el-upload': Upload,
		},
		props: ["editForm"],
		data() {
			return {
				attachPath: attachPath //附件绝对地址

			}
		},
		methods: {
			/* 图片显示路径转换 */
			nodeIconUrl(url) {
				if (!url){
					return ''
				}
				if (url && url.search('http') < 0) {//绝对路径转换
					url = attachPath + url
				}
				console.log(url)
				return url
			}
		}
	}
</script>
